var strStr = function(haystack, needle) {
    if(!needle.length){
        return 0
    }
    var l1 = needle.length
    var l2 = haystack.length - l1
    for (var i = 0; i<=l2; i++) {
                if (haystack.substring(i, i+l1) == needle) {
                    return i;
                }
            }
            return -1;
    
    };